define(function(require, exports, modules) {
  var $ = require('jquery');
  var bxslider = require("bxslider");
  var Countdown = require('countdown');

  require("simplemodal")($);
  var curModal
  $(function() {
   console.log("ddddddddd")
    var slider = $('.dd-slider-banner0').bxSlider({
        'mode': "horizontal",
        'displaySlideQty': 1, //定义显示个数
        'moveSlideQty': 1, //移动个数
        'speed': 500,
        "auto": true,
        'pager': true,
        'pagerSelector': ".dd-slider-pager0"
      })
      // 倒计时之进行中
    function GetRTime() {
      var EndTime = new Date('2014/12/29 10:00:00'); //截止时间
      var NowTime = new Date();
      var t = EndTime.getTime() - NowTime.getTime();

      var d = Math.floor(t / 1000 / 60 / 60 / 24);
      var h = Math.floor(t / 1000 / 60 / 60 % 24);
      var m = Math.floor(t / 1000 / 60 % 60);
      var s = Math.floor(t / 1000 % 60);
      $(".start").find(".endtime").html(d + '天' + h + '小时' + m + '分' + s + '秒')
      $(".starting").find(".endtime").html(d + '天' + h + '小时' + m + '分' + s + '秒')
    }
    setInterval(GetRTime, 1000);
    var remain_time = function() {
      var myDate = new Date();
      var nowdate = myDate.getDate();

      var nextTime = '2014-12-' + '26' + ' 21:00:00';

      new Countdown(nextTime, function(time) {
        $('#M_seckill_time').find(".y1").text(time.dd);
        $('#M_seckill_time').find(".y2").text(time.hh);
        $('#M_seckill_time').find(".y3").text(time.mm);
        $('#M_seckill_time').find(".y4").text(time.ss);

      }, function() {
        $("#M_seckill_time").html("正在抢购中...")
      })

    }
    remain_time();
    $("#d").click(function() {
      curModal = $(".week_show_wrap").modal({
        escClose: true,
        close: true,
        overlayClose: true,
        closeClass: 'week_show_close'
      });
      return false
    })




    $('.arrow-left').on('click', function(e) {
      e.preventDefault()
      mySwiper.swipePrev()
    })
    $('.arrow-right').on('click', function(e) {
      e.preventDefault()
      mySwiper.swipeNext()
    })
  })

})